package com.maslyk.invitation.page;

import java.io.IOException;
import java.util.Locale;

import javax.faces.FacesException;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;

public class CustomViewHandler extends ViewHandler {

	protected ViewHandler baseViewHandler;

	public CustomViewHandler(ViewHandler viewHandler) {
		super();
		this.baseViewHandler = viewHandler;
	}

	public Locale calculateLocale(FacesContext context) {
		Locale loc = baseViewHandler.calculateLocale(context);
		return loc;
	}

	public String calculateRenderKitId(FacesContext context) {
		return baseViewHandler.calculateRenderKitId(context);
	}

	public UIViewRoot createView(FacesContext context, String viewName) {
		return baseViewHandler.createView(context, viewName);
	}

	public String getActionURL(FacesContext context, String arg1) {
		return baseViewHandler.getActionURL(context, arg1);
	}

	public String getResourceURL(FacesContext context, String arg1) {
		return baseViewHandler.getResourceURL(context, arg1);
	}

	public void renderView(FacesContext context, UIViewRoot viewRoot)
			throws IOException, FacesException {
		baseViewHandler.renderView(context, viewRoot);
	}

	public UIViewRoot restoreView(FacesContext context, String arg1) {
		return baseViewHandler.restoreView(context, arg1);
	}

	public void writeState(FacesContext context) throws IOException {
		baseViewHandler.writeState(context);

	}
	
	public String calculateCharacterEncoding(FacesContext arg0) {
		return "UTF-8";
	}
}